<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<style type="text/css">
	body{
	background:url(images/1.jpg);
	background-size:100% 100%;
	margin:0 auto;
	}
	#login_frame {
    width: 440px;
    height: 360px;
    padding: 13px;
 
    position: absolute;
    left: 50%;
    top: 40%;
    margin-left: -200px;
    margin-top: -200px;
 
    background-color: rgba(240, 255, 255, 0.5);
 
    border-radius: 10px;
    text-align: center;
}
	h1{
		margin-top: 150px;
		text-align: center;
	}	
	</style>
</head>
<body>
<div id="login_frame">
<?php
$isset1=$_POST["user"];
$isset2=$_POST["pass"];
if (!($isset1 and $isset2))
{
	echo "你输入的登录账号或密码为空！<p>";
	echo "单击<a href='login_l.php'>这里</a>重新登录";
}
else
{
	include_once("conn.php");//链接数据库文件引用
	$user=$_POST["user"];
	$pass=$_POST["pass"];
	$sql="select * from db_user";
	$rs=$pdo->query($sql);
	$list=$rs->fetchAll(PDO::FETCH_ASSOC);
	$num=count($list);
	if ($num==0)
	{
		echo "<center>";
		echo "用户名或密码错误！<p>";
		echo "单击<a href='login_l.php'>这里</a>重新登录";
		echo "</center>";
	}
	else
	{
		setcookie("user",$user);
		echo "<center>";
		echo "<h1>登录成功</h1>";
		echo "单击<a href='index.php'>这里</a>进入系统";
		echo "</center>";
	}
}
?>
</div>
</body>
</html>
